/**
 *    Copyright (c) [2022] [中和农信]
 *    rabbit-mq-plus is licensed under Mulan PSL v2.
 *    You can use this software according to the terms and conditions of the Mulan PSL v2.
 *    You may obtain a copy of Mulan PSL v2 at:
 *             http://license.coscl.org.cn/MulanPSL2
 *    THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 *    See the Mulan PSL v2 for more details.
 *
 */
package com.cfpamf.athean.rabbit.mq.plus.producer.core.event;

import org.springframework.context.ApplicationEvent;

import com.cfpamf.athean.rabbit.mq.plus.domain.dto.RabbitMqPlusMessageDTO;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Getter
@EqualsAndHashCode(callSuper = false)
public class RabbitMqPlusProducerMessageSendEvent extends ApplicationEvent {

    private static final long serialVersionUID = -840628604165774837L;

    private final RabbitMqPlusMessageDTO rabbitMqPlusMessageDTO;

    public RabbitMqPlusProducerMessageSendEvent(Object source, final RabbitMqPlusMessageDTO rabbitMqPlusMessageDTO) {
        super(source);
        this.rabbitMqPlusMessageDTO = rabbitMqPlusMessageDTO;
        log.info("[rabbitMqPlus]生产者消息记录入库完成，{} {} {} 事件广播", rabbitMqPlusMessageDTO.getExchange(),
            rabbitMqPlusMessageDTO.getEventNo(), rabbitMqPlusMessageDTO.getEventTypeCode());
    }

}
